package com.huanwang.commonlibrary.base

import android.app.Application
import android.content.Context
import androidx.multidex.MultiDex
import com.huanwang.commonlibrary.help.stateview.ErrorState
import com.huanwang.commonlibrary.help.stateview.LoadingState
import com.tqzhang.stateview.core.LoadState


open class BaseApplication : Application() {
    override fun onCreate() {
        super.onCreate()
        context = this
        LoadState.Builder()
            .register(ErrorState())
            .register(LoadingState())
            .build()
    }

    override fun attachBaseContext(base: Context) {
        super.attachBaseContext(base)
        // you must install multiDex whatever tinker is installed!
        MultiDex.install(base)
    }

    companion object {
      lateinit  var context: BaseApplication
    }

}